home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / widget / nsILookAndFeel.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  11KB  |  255 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #ifndef __nsILookAndFeel
  39. #define __nsILookAndFeel
  40. #include "nsISupports.h"
  41. #include "nsColor.h"
  42.  
  43.   // for |#ifdef NS_DEBUG|
  44. struct nsSize;
  45.  
  46.  
  47. // {ED0B4802-9F50-4f69-9509-6949C69999E4}
  48. #define NS_ILOOKANDFEEL_IID \
  49. { 0xed0b4802, 0x9f50, 0x4f69, \
  50.     { 0x95, 0x9, 0x69, 0x49, 0xc6, 0x99, 0x99, 0xe4 } }
  51.  
  52. class nsILookAndFeel: public nsISupports {
  53. public:
  54.     NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILOOKANDFEEL_IID)
  55.  
  56.   // When modifying this list, also modify nsXPLookAndFeel::sColorPrefs
  57.   // in widget/src/xpwidgts/nsXPLookAndFeel.cpp.
  58.   typedef enum {
  59.  
  60.     // WARNING : NO NEGATIVE VALUE IN THIS ENUMERATION
  61.     // see patch in bug 57757 for more information
  62.  
  63.     eColor_WindowBackground,
  64.     eColor_WindowForeground,
  65.     eColor_WidgetBackground,
  66.     eColor_WidgetForeground,
  67.     eColor_WidgetSelectBackground,
  68.     eColor_WidgetSelectForeground,
  69.     eColor_Widget3DHighlight,
  70.     eColor_Widget3DShadow,
  71.     eColor_TextBackground,
  72.     eColor_TextForeground,
  73.     eColor_TextSelectBackground,
  74.     eColor_TextSelectForeground,
  75.     eColor_TextSelectBackgroundDisabled,
  76.     eColor_TextSelectBackgroundAttention,
  77.  
  78.     // New CSS 2 color definitions
  79.     eColor_activeborder,
  80.     eColor_activecaption,
  81.     eColor_appworkspace,
  82.     eColor_background,
  83.     eColor_buttonface,
  84.     eColor_buttonhighlight,
  85.     eColor_buttonshadow,
  86.     eColor_buttontext,
  87.     eColor_captiontext,
  88.     eColor_graytext,
  89.     eColor_highlight,
  90.     eColor_highlighttext,
  91.     eColor_inactiveborder,
  92.     eColor_inactivecaption,
  93.     eColor_inactivecaptiontext,
  94.     eColor_infobackground,
  95.     eColor_infotext,
  96.     eColor_menu,
  97.     eColor_menutext,
  98.     eColor_scrollbar,
  99.     eColor_threeddarkshadow,
  100.     eColor_threedface,
  101.     eColor_threedhighlight,
  102.     eColor_threedlightshadow,
  103.     eColor_threedshadow,
  104.     eColor_window,
  105.     eColor_windowframe,
  106.     eColor_windowtext,
  107.  
  108.     eColor__moz_buttondefault,
  109.     // Colors which will hopefully become CSS3
  110.     eColor__moz_field,
  111.     eColor__moz_fieldtext,
  112.     eColor__moz_dialog,
  113.     eColor__moz_dialogtext,
  114.     eColor__moz_dragtargetzone,                //used to highlight valid regions to drop something onto
  115.  
  116.     eColor__moz_cellhighlight,                               //used to cell text background, selected but not focus
  117.     eColor__moz_cellhighlighttext,                           //used to cell text, selected but not focus
  118.     eColor__moz_buttonhoverface,                             //used to button text background, when mouse is over
  119.     eColor__moz_buttonhovertext,                             //used to button text, when mouse is over
  120.     eColor__moz_menuhover,                                   //used to menu item background, when mouse is over
  121.     eColor__moz_menuhovertext,                               //used to menu item text, when mouse is over
  122.  
  123.     //colours needed by Mac Classic skin
  124.     eColor__moz_mac_focusring,                //ring around text fields and lists
  125.     eColor__moz_mac_menuselect,                //colour used when mouse is over a menu item
  126.     eColor__moz_mac_menushadow,                //colour used to do shadows on menu items
  127.     eColor__moz_mac_menutextselect,            //colour used to display text while mouse is over a menu item
  128.  
  129.       //all of the accent colours
  130.       eColor__moz_mac_accentlightesthighlight,
  131.     eColor__moz_mac_accentregularhighlight,
  132.     eColor__moz_mac_accentface,
  133.     eColor__moz_mac_accentlightshadow,
  134.     eColor__moz_mac_accentregularshadow,
  135.     eColor__moz_mac_accentdarkshadow,
  136.     eColor__moz_mac_accentdarkestshadow,
  137.   
  138.     // keep this one last, please
  139.     eColor_LAST_COLOR
  140.   } nsColorID;
  141.  
  142.   // When modifying this list, also modify nsXPLookAndFeel::sIntPrefs
  143.   // in widget/src/xpwidgts/nsXPLookAndFeel.cpp.
  144.   typedef enum {
  145.     eMetric_WindowTitleHeight,
  146.     eMetric_WindowBorderWidth,
  147.     eMetric_WindowBorderHeight,
  148.     eMetric_Widget3DBorder,
  149.     eMetric_TextFieldBorder,                              // Native border size
  150.     eMetric_TextFieldHeight,
  151.     eMetric_TextVerticalInsidePadding,                    // needed only because of GTK
  152.     eMetric_TextShouldUseVerticalInsidePadding,           // needed only because of GTK
  153.     eMetric_TextHorizontalInsideMinimumPadding,  
  154.     eMetric_TextShouldUseHorizontalInsideMinimumPadding,  // needed only because of GTK
  155.     eMetric_ButtonHorizontalInsidePaddingNavQuirks,  
  156.     eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks, 
  157.     eMetric_CheckboxSize,
  158.     eMetric_RadioboxSize,
  159.     
  160.     eMetric_ListShouldUseHorizontalInsideMinimumPadding,  // needed only because of GTK
  161.     eMetric_ListHorizontalInsideMinimumPadding,         
  162.  
  163.     eMetric_ListShouldUseVerticalInsidePadding,           // needed only because of GTK
  164.     eMetric_ListVerticalInsidePadding,                    // needed only because of GTK
  165.  
  166.     eMetric_CaretBlinkTime,                               // default, may be overriden by OS
  167.     eMetric_CaretWidth,                                   // pixel width of caret
  168.     eMetric_ShowCaretDuringSelection,                       // show the caret when text is selected?
  169.     eMetric_SelectTextfieldsOnKeyFocus,                   // select textfields when focused via tab/accesskey?
  170.     eMetric_SubmenuDelay,                                 // delay before submenus open
  171.     eMetric_MenusCanOverlapOSBar,                         // can popups overlap menu/task bar?
  172.     eMetric_DragFullWindow,                               // show window contents while dragging?
  173.     eMetric_DragThresholdX,                               // begin a drag if the mouse is moved further than the threshold while the button is down
  174.     eMetric_DragThresholdY,
  175.     eMetric_UseAccessibilityTheme,                        // Accessibility theme being used?
  176.     eMetric_IsScreenReaderActive,                         // Screen reader being used?
  177.  
  178.     eMetric_ScrollArrowStyle,                             // position of scroll arrows in a scrollbar
  179.     eMetric_ScrollSliderStyle,                            // is scroll thumb proportional or fixed?
  180.  
  181.     eMetric_TreeOpenDelay,                                // delay for opening spring loaded folders
  182.     eMetric_TreeCloseDelay,                               // delay for closing spring loaded folders
  183.     eMetric_TreeLazyScrollDelay,                          // delay for triggering the tree scrolling
  184.     eMetric_TreeScrollDelay,                              // delay for scrolling the tree
  185.     eMetric_TreeScrollLinesMax,                           // the maximum number of lines to be scrolled at ones
  186.     eMetric_TabFocusModel                                 // What type of tab-order to use
  187.   } nsMetricID;
  188.  
  189.   enum {
  190.     eMetric_ScrollArrowStyleSingle,                       // single arrow at each end
  191.     eMetric_ScrollArrowStyleBothAtBottom,                 // both arrows at bottom/right, none at top/left
  192.     eMetric_ScrollArrowStyleBothAtEachEnd,                // both arrows at both ends
  193.     eMetric_ScrollArrowStyleBothAtTop                     // both arrows at top/left, none at bottom/right
  194.   };
  195.   enum {
  196.     eMetric_ScrollThumbStyleNormal,
  197.     eMetric_ScrollThumbStyleProportional
  198.   };
  199.   
  200.   // When modifying this list, also modify nsXPLookAndFeel::sFloatPrefs
  201.   // in widget/src/xpwidgts/nsXPLookAndFeel.cpp.
  202.   typedef enum {
  203.     eMetricFloat_TextFieldVerticalInsidePadding,
  204.     eMetricFloat_TextFieldHorizontalInsidePadding,
  205.     eMetricFloat_TextAreaVerticalInsidePadding,
  206.     eMetricFloat_TextAreaHorizontalInsidePadding,
  207.     eMetricFloat_ListVerticalInsidePadding,
  208.     eMetricFloat_ListHorizontalInsidePadding,
  209.     eMetricFloat_ButtonVerticalInsidePadding,
  210.     eMetricFloat_ButtonHorizontalInsidePadding
  211.   } nsMetricFloatID;
  212.  
  213.   NS_IMETHOD GetColor(const nsColorID aID, nscolor &aColor) = 0;
  214.   NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric) = 0;
  215.   NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric) = 0;
  216.   
  217.   NS_IMETHOD LookAndFeelChanged() = 0;
  218.  
  219.  
  220. #ifdef NS_DEBUG
  221.   typedef enum {
  222.     eMetricSize_TextField = 0,
  223.     eMetricSize_TextArea  = 1,
  224.     eMetricSize_ListBox   = 2,
  225.     eMetricSize_ComboBox  = 3,
  226.     eMetricSize_Radio     = 4,
  227.     eMetricSize_CheckBox  = 5,
  228.     eMetricSize_Button    = 6
  229.   } nsMetricNavWidgetID;
  230.  
  231.   typedef enum {
  232.     eMetricSize_Courier   = 0,
  233.     eMetricSize_SansSerif = 1
  234.   } nsMetricNavFontID;
  235.  
  236.   // This method returns the actual (or nearest estimate) 
  237.   // of the Navigator size for a given form control for a given font
  238.   // and font size. This is used in NavQuirks mode to see how closely
  239.   // we match its size
  240.   NS_IMETHOD GetNavSize(const nsMetricNavWidgetID aWidgetID,
  241.                         const nsMetricNavFontID   aFontID, 
  242.                         const PRInt32             aFontSize, 
  243.                         nsSize &aSize) = 0;
  244. #endif
  245. };
  246.  
  247.     // On the Mac, GetColor(eColor_TextSelectForeground, color) returns this
  248.     // constant to specify that the foreground color should not be changed
  249.     // (ie. a colored text keeps its colors  when selected).
  250.     // Of course if other plaforms work like the Mac, they can use it too.
  251. #define NS_DONT_CHANGE_COLOR     NS_RGB(0x01, 0x01, 0x01)
  252.  
  253.  
  254. #endif /* __nsILookAndFeel */
  255.